package com.brainhealth.customer.service.impl;

import java.util.List;
import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.ScoreConsumeRecordMapper;
import com.brainhealth.customer.domain.ScoreConsumeRecord;
import com.brainhealth.customer.service.IScoreConsumeRecordService;

/**
 * 积分消耗记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-06
 */
@Service
public class ScoreConsumeRecordServiceImpl implements IScoreConsumeRecordService 
{
    @Autowired
    private ScoreConsumeRecordMapper scoreConsumeRecordMapper;

    /**
     * 查询积分消耗记录
     * 
     * @param id 积分消耗记录主键
     * @return 积分消耗记录
     */
    @Override
    public ScoreConsumeRecord selectScoreConsumeRecordById(Long id)
    {
        return scoreConsumeRecordMapper.selectScoreConsumeRecordById(id);
    }

    @Override
    public Integer getMaxScoreConsumeRecordId() {
        return scoreConsumeRecordMapper.getMaxScoreConsumeRecordId();
    }

    /**
     * 查询积分消耗记录列表
     * 
     * @param scoreConsumeRecord 积分消耗记录
     * @return 积分消耗记录
     */
    @Override
    public List<ScoreConsumeRecord> selectScoreConsumeRecordList(ScoreConsumeRecord scoreConsumeRecord)
    {
        return scoreConsumeRecordMapper.selectScoreConsumeRecordList(scoreConsumeRecord);
    }

    /**
     * 新增积分消耗记录
     * 
     * @param scoreConsumeRecord 积分消耗记录
     * @return 结果
     */
    @Override
    public int insertScoreConsumeRecord(ScoreConsumeRecord scoreConsumeRecord)
    {
        scoreConsumeRecord.setCreateTime(DateUtils.getNowDate());
        return scoreConsumeRecordMapper.insertScoreConsumeRecord(scoreConsumeRecord);
    }

    /**
     * 修改积分消耗记录
     * 
     * @param scoreConsumeRecord 积分消耗记录
     * @return 结果
     */
    @Override
    public int updateScoreConsumeRecord(ScoreConsumeRecord scoreConsumeRecord)
    {
        scoreConsumeRecord.setUpdateTime(DateUtils.getNowDate());
        return scoreConsumeRecordMapper.updateScoreConsumeRecord(scoreConsumeRecord);
    }

    /**
     * 批量删除积分消耗记录
     * 
     * @param ids 需要删除的积分消耗记录主键
     * @return 结果
     */
    @Override
    public int deleteScoreConsumeRecordByIds(Long[] ids)
    {
        return scoreConsumeRecordMapper.deleteScoreConsumeRecordByIds(ids);
    }

    /**
     * 删除积分消耗记录信息
     * 
     * @param id 积分消耗记录主键
     * @return 结果
     */
    @Override
    public int deleteScoreConsumeRecordById(Long id)
    {
        return scoreConsumeRecordMapper.deleteScoreConsumeRecordById(id);
    }
}
